package cn.fzkj.project.user.service.impl;

import cn.fzkj.project.user.mapper.UserMapper;
import cn.fzkj.project.user.domain.User;
import cn.fzkj.project.user.service.IUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

@Primary
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAllUsers() {
        return userMapper.selectList(null);
    }

    @Override
    public User selectUserByUserName(String username) {
        QueryWrapper query = new QueryWrapper();
        query.eq("user_real_name", username);
        return userMapper.selectOne(query);
    }
}
